<template>
   <el-card class="box-card">
       <ul>
           <li
              draggable="true"
              :data-name="dataname"
              :data-id="id"
              @dragstart="dragStart"
            >这里是li标签</li>
       </ul>
   </el-card>
</template>

<script>
export default {
  data () {
    return {
      dataname: 'dataname',
      id: 0
    }
  },
  methods: {
    dragStart (e, type) {
      console.log(e.target.getAttribute('dataname'))
      e.dataTransfer.setData('info', '111')
      console.log(e.dataTransfer.getData('info'))
    }
  }
}
</script>

<style scoped lang="less">
.el-card{
    height: calc(100vh - 40px);
}
</style>
